home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17830 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: druid.borland.com!usenet
  2. From: pete@borland.com (Pete Becker)
  3. Newsgroups: comp.os.ms-windows.programmer.tools.misc,comp.os.ms-windows.programmer.win32,comp.os.ms-windows.programmer.misc,comp.lang.c++
  4. Subject: Re: [Q] Why doesn't this compile?
  5. Date: 17 Apr 1996 18:44:05 GMT
  6. Organization: Borland International
  7. Message-ID: <4l3e5l$e1t@druid.borland.com>
  8. References: <317523C0.5042@eps.agfa.be>
  9. NNTP-Posting-Host: pbecker.borland.com
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=ISO-8859-1
  12. X-Newsreader: WinVN 0.99.5
  13.  
  14. In article <317523C0.5042@eps.agfa.be>, rorlic@eps.agfa.be says...
  15. >
  16. >Using MSVC 4.0 compiler I get the following:
  17. >
  18. >File test.cpp: ---------------------------------
  19. >
  20. >class A {
  21. >public:
  22. >        class L {
  23. >        public:
  24. >                L() {}
  25. >                virtual void f() {
  26. >                        int dummy = 0;
  27. >                }
  28. >        };
  29. >        A();
  30. >};
  31. >
  32. >class B : public A {
  33. >        class L : public A::L {
  34. >        public:
  35. >                L() {}
  36. >                virtual void f() {
  37. >                        A::L::f();
  38. >                }
  39. >        };
  40. >        B();
  41. >};
  42. >
  43. >Compilation result: ----------------------------
  44. >
  45. >test.cpp(18) : error C2352: 'A::L::f' : illegal call of 
  46. >nonstatic member function
  47. >Error executing cl.exe.
  48. >test.obj - 1 error(s), 1 warning(s)
  49. >
  50. >------------------------------------------------
  51. >
  52. >Anybody knows what's wrong with it?
  53.  
  54. There's nothing wrong with it. The problem is in your compiler.
  55.     -- Pete
  56.  
  57.